def loop(x):
    t=str(x)
    d=t[::-1]
    if t==d:
        return 1
    else:
        return 0
    a,b =map(int,input().split())
    for i in range(a,b1):
        if loop(i)==1:
            print(i)